using OracleInternal.Json.Common;

namespace OracleInternal.Json.Binary
{
	internal class OsonContext
	{
		internal OsonBuffer m_osonBuffer;

		internal OsonHeader m_osonHeader;

		internal OracleOsonValueFactory m_valueFactory;

		internal IExceptionFactory m_exceptionFactory;

		internal OsonContext(OsonBuffer buffer, OsonHeader header, OracleOsonValueFactory valueFactory, IExceptionFactory exceptionFactory)
		{
			m_osonBuffer = buffer;
			m_osonHeader = header;
			m_exceptionFactory = exceptionFactory;
			m_valueFactory = valueFactory;
		}

		internal OsonContext(OsonBuffer buffer, OsonHeader header)
			: this(buffer, header, OracleOsonValueFactory.INSTANCE, OracleJsonExceptions.ORACLE_FACTORY)
		{
		}

		internal OsonContext(OsonBuffer buffer)
			: this(buffer, new OsonHeader(buffer, OracleJsonExceptions.ORACLE_FACTORY))
		{
		}

		internal OsonContext(OsonContext other)
			: this(other.m_osonBuffer, other.m_osonHeader)
		{
		}

		internal OsonHeader GetHeader()
		{
			return m_osonHeader;
		}

		internal OracleOsonValueFactory GetFactory()
		{
			return m_valueFactory;
		}

		internal IExceptionFactory GetExceptionFactory()
		{
			return m_exceptionFactory;
		}
	}
}
